# -*- coding: utf-8 -*-
# @Time    : 2022/1/11 22:38
# @Author  : 徐翊宸
# @Email   : xyc@163.com
# @File    : page_tjdxmb.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class TjdxMbPage(BasePage):

    gengduo_locator = (By.LINK_TEXT, "更多")
    yx_submit_locator = (By.LINK_TEXT, "营销")
    sz_submit_locator = (By.LINK_TEXT, "设置")
    tjdxmb_locator = (By.LINK_TEXT, "添加短信模板")
    biaoti_locator = (By.CSS_SELECTOR, "#dialog-add > form > table > tbody > tr:nth-child(2) > td:nth-child(2) > input")
    neirong_locator = (By.CSS_SELECTOR, "#content")
    bcun_locator = (By.CSS_SELECTOR, "#dialog-add > form > table > tfoot > tr > td > input.btn.btn-primary")

    def gengduo_click(self):
        self.driver.find_element(*self.gengduo_locator).click()

    def yx_submit_click(self):
        self.driver.find_element(*self.yx_submit_locator).click()

    def sz_submit_click(self):
        self.driver.find_element(*self.sz_submit_locator).click()

    def tjdxmb_click(self):
        self.driver.find_element(*self.tjdxmb_locator).click()

    def biaoti_input(self, biaoti):
        self.driver.find_element(*self.biaoti_locator).send_keys(biaoti)

    def neirong_input(self, neirong):
        self.driver.find_element(*self.neirong_locator).send_keys(neirong)

    def bcun_click(self):
        self.driver.find_element(*self.bcun_locator).click()
